package com.lvmama.search.spider.proxy;

public class ProxyIp {
	
	public ProxyIp(String ip,int port) {
		this(ip, port, "http");
	}
	
	public ProxyIp(String ip,int port,String scheme) {
		super();
		this.port = port;
		this.ip = ip;
		this.scheme = scheme;
	}

	
	private String ip;
	
	private int port;
	
	private boolean validate;
	
	/**
	 * http,https
	 */
	private String scheme;

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public boolean isValidate() {
		return validate;
	}

	public void setValidate(boolean validate) {
		this.validate = validate;
	}

	public String getScheme() {
		return scheme;
	}

	public void setScheme(String scheme) {
		this.scheme = scheme;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj instanceof ProxyIp) {
			return this.ip.equals(((ProxyIp) obj).getIp());
		}
		return false;
		
	}

	@Override
	public String toString() {
		return "ProxyIp [port=" + port + ", ip=" + ip + ", validate=" + validate + ", scheme=" + scheme + "]";
	}
	
}